<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp"%>
<script type="text/javascript">
	$(function() {
        $('#cloudStorageConfigAddForm').form({
            url : '${path}/cloudStorageConfig/add',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    //之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#cloudStorageConfigAddForm');
                    parent.$.messager.alert('错误', eval(result.msg), 'error');
                }
            }
        });
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false"
		style="overflow: hidden;padding: 3px;">
		<form id="cloudStorageConfigAddForm" method="post">
			<table class="grid">
				<tr>
					<td><div class="col-sm-2 control-label">存储类型</div>
					</td>
					<td><div class="form-group">
							<label class="radio-inline"><input type="radio"
								name="type" value="1"> 七牛 </label> <label class="radio-inline"><input
								type="radio" name="type" value="2"> 阿里云 </label> <label
								class="radio-inline"><input type="radio" name="type"
								value="3"> 腾讯云 </label>
						</div>
					</td>
				</tr>
				<tr>
					<td>域名</td>
					<td><input name="name" type="text" class="easyui-validatebox"
						data-options="required:true" value="${cloudStorageConfig.name}" />
					</td>
				</tr>
				<tr>
					<td>路径前缀</td>
					<td><input name="value" type="text" class="easyui-validatebox"
						data-options="required:true" value="${cloudStorageConfig.value}" />
					</td>
				</tr>
				<tr>
					<td>AccessKey</td>
					<td><input name="status" type="text"
						class="easyui-validatebox" data-options="required:true"
						value="${cloudStorageConfig.status}" /></td>
				</tr>

				<tr>
					<td>SecretKey</td>
					<td><input name="remark" type="text"
						class="easyui-validatebox" data-options="required:true"
						value="${cloudStorageConfig.remark}" /></td>
				</tr>
				<tr>
					<td>空间名</td>
					<td><input name="remark" type="text"
						class="easyui-validatebox" data-options="required:true"
						value="${cloudStorageConfig.remark}" /></td>
				</tr>
			</table>
		</form>
	</div>
</div>